package com.study.base

import com.study.base.empty_service.EmptyAccountService
import com.study.base.empty_service.EmptyHotService
import com.study.base.service.IAccountService
import com.study.base.service.IHotService

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/21
 *     desc   : 组件服务工厂
 * </pre>
 */
class ServiceFactory private constructor() {

    var hotService: IHotService? = null
        get() {
            if (field == null) {
                field = EmptyHotService()
            }
            return field
        }

    var accountService: IAccountService? = null
        get() {
            if (field == null) {
                field = EmptyAccountService()
            }
            return field
        }

    companion object {
        val INSTANCE by lazy {
            ServiceFactory()
        }
    }
}